<!--<script charset="utf-8" src="/public/assets/script/kindeditor-4.1.10/kindeditor-min.js"></script>
<script charset="utf-8" src="/public/assets/script/kindeditor-4.1.10/lang/zh_CN.js"></script>
<script charset="utf-8" src="/public/assets/script/kindeditor-4.1.10/php/upload_json.php"></script>
<script>
    var editor;
    KindEditor.ready(function(K) {
        editor = K.create('textarea', {
                allowFileManager : true,
                afterBlur: function(){this.sync();}
        });
    }); 
</script>-->
<style>
select{padding: 5px;margin-right: 20px;color: #555555;}
.col-sm-10 label{font-weight: 500;}
</style>
<section class="vbox">
    <section class="scrollable padder">
        <ul class="breadcrumb no-border no-radius b-b b-light pull-in">
            <li><a href="#"><i class="fa fa-home"></i> 系统管理</a></li>
            <li><a href="#">资料管理</a></li>
            <li class="active"><a href="#">酒店基础资料管理</a></li>
        </ul>
        <div class="m-b-md">
            <h3 class="m-b-none">酒店基础资料管理</h3>
        </div>
        <section class="panel panel-default">
            <div class="panel-body">
            <form class="form-horizontal form-bordered form-validate" method="post" action="<?=$this->url('user/basicEdit')?>" enctype="multipart/form-data" id="hotelform" >
                <div class="form-group" style="margin-top: 10px;">
                    <label class="col-sm-2 control-label"><span style="color:red;">* </span>星级/省/市/区：</label>
                    <div class="col-sm-10">
                        星级：<select name="data[star]">
                            <option value="0" <?=!empty($rs)&&$rs['star']==0?'selected':''?>>无星级</option>
                            <option value="1" <?=!empty($rs)&&$rs['star']==1?'selected':''?>>一星级</option>
                            <option value="2" <?=!empty($rs)&&$rs['star']==2?'selected':''?>>二星级</option>
                            <option value="3" <?=!empty($rs)&&$rs['star']==3?'selected':''?>>三星级</option>
                            <option value="4" <?=!empty($rs)&&$rs['star']==4?'selected':''?>>四星级</option>
                            <option value="5" <?=!empty($rs)&&$rs['star']==5?'selected':''?>>五星级</option>
                        </select>
                        省：<select name="data[province]">
                            <option value="0">请选择</option>
                            <?
                            if(!empty($province)){
                                foreach($province as $k=>$v){?>
                                    <option value="<?=$v['osiiid']?>" <?=!empty($rs)&&$rs['province']==$v['osiiid']?'selected':''?> ><?=$v['name']?></option>
                                <?}
                            }
                            ?>
                        </select>
                        市：<select name="data[city]">
                            <option value="0">请选择</option>
                            <?
                            if($city){
                                foreach($city as $k=>$v){?>
                                    <option value="<?=$v['osiiid']?>" <?=$rs['city']==$v['osiiid']?'selected':''?> ><?=$v['name']?></option>
                                <?}
                            }
                            ?>
                        </select>
                        区：<select name="data[county]">
                            <option value="0">请选择</option>
                            <?
                            if($county){
                                foreach($county as $k=>$v){?>
                                    <option value="<?=$v['osiiid']?>" <?=$rs['county']==$v['osiiid']?'selected':''?> ><?=$v['name']?></option>
                                <?}
                            }
                            ?>
                        </select>
                    </div>
                </div>
                
                <div class="form-group" style="margin-top: 10px;">
                    <label class="col-sm-2 control-label"><span style="color:red;">* </span>酒店名称：</label>
                    <div class="col-sm-10">
                        <input type="text" class="form-control" name="data[hotelName]" value="<?=empty($rs)?'':$rs['hotelName']?>">
                    </div>
                </div>
                
                <div class="form-group" style="margin-top: 10px;">
                    <label class="col-sm-2 control-label"><span style="color:red;">* </span>街道地址：</label>
                    <div class="col-sm-10">
                        <input type="text" class="form-control" name="data[address]" value="<?=empty($rs)?'':$rs['address']?>">
                    </div>
                </div>
                
                <div class="form-group" style="margin-top: 10px;">
                    <label class="col-sm-2 control-label"><span style="color:red;">* </span>订单接收(手机号)：</label>
                    <div class="col-sm-10">
                        <input type="text" class="form-control" name="data[phone]" placeholder="多个手机号用半角逗号(,)隔开即可" value="<?=empty($rs)?'':$rs['phone']?>">
                    </div>
                </div>
                
                <div class="form-group" style="margin-top: 10px;">
                    <label class="col-sm-2 control-label"><span style="color:red;">* </span>值班人联系电话：</label>
                    <div class="col-sm-10">
                        <input type="text" class="form-control" name="data[work]" placeholder="多个联系方式用半角逗号(,)隔开即可" value="<?=empty($rs)?'':$rs['work']?>">
                    </div>
                </div>
                
                <div class="form-group" style="margin-top: 10px;">
                    <label class="col-sm-2 control-label"><span style="color:red;">* </span>前台电话：</label>
                    <div class="col-sm-10">
                        <input type="text" class="form-control" name="data[tel]" value="<?=empty($rs)?'':$rs['tel']?>">
                    </div>
                </div>
                <?if($this->partnerInfo['isbusiness']==1){?>
                    <div class="form-group" style="margin-top: 10px;">
                        <label class="col-sm-2 control-label"><span style="color:red;">* </span>开户行：</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" name="data[bank]" value="<?=empty($rs)?'':$rs['bank']?>">
                        </div>
                    </div>
                    <div class="form-group" style="margin-top: 10px;">
                        <label class="col-sm-2 control-label"><span style="color:red;">* </span>收款账户名称：</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" name="data[contactsName]" value="<?=empty($rs)?'':$rs['contactsName']?>">
                        </div>
                    </div>
                    <div class="form-group" style="margin-top: 10px;">
                        <label class="col-sm-2 control-label"><span style="color:red;">* </span>账号：</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" name="data[contacts]" value="<?=empty($rs)?'':$rs['contacts']?>">
                        </div>
                    </div>
                <?}else{?>
                    <div class="form-group" style="margin-top: 10px;">
                        <label class="col-sm-2 control-label"><span style="color:red;">* </span>银行对公收款账号：</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" name="data[contacts]" value="<?=empty($rs)?'':$rs['contacts']?>">
                        </div>
                    </div>
                <?}?>
                <div class="form-group">
                    <div class="col-sm-4 col-sm-offset-2">
                        <button type="button" onclick="window.history.go(-1);" class="btn btn-default">返 回</button>
                        <button type="submit" class="btn btn-primary show_shadefrist">保 存</button>
                        <a href="<?=$this->url('user/basicinfo')?>"><button type="button" class="btn btn-primary">详细信息</button></a>
                        <button type="reset" class="btn btn-primary">重 置</button>
                    </div>
                </div>
            </form>
            </div>
        </section>
    </section>
</section>
<a href="#" class="hide nav-off-screen-block" data-toggle="class:nav-off-screen" data-target="#nav"></a>
<script type="text/javascript">

$('select[name="data[province]"]').change(function(){
    var provinceid=$('select[name="data[province]"] option:selected').val();
    onseleted(1,provinceid);
});
$('select[name="data[city]"]').change(function(){
    var cityid=$('select[name="data[city]"] option:selected').val();
    onseleted(2,cityid);
});
function onseleted(type,parentid){
    $.ajax({
        type:'post',
        url:"<?=$this->url('user/get_address')?>",
        data:"type="+type+"&parentid="+parentid,
        dataType:'json',
        success:function (msg){
            if(msg.type==1){
                $('select[name="data[city]"]').html(msg.html);
                $('select[name="data[county]"]').html("<option value='0'>请选择</option>");
            }else if(msg.type==2){
                $('select[name="data[county]"]').html(msg.html);
            }
        },error:function(){
            pub_alert_error("ajax错误",2000);
        }
    });
}
</script>